package assignmentonepenguins

class Listing {
    String name
    Date endDate
    Double startBid
    String description
    Date dateCreated
    String createdBy
    boolean expired

    static constraints = {
        name(size: 1..63)
        description(nullable: true, size: 0..255)
        winner(nullable: true)
        biddings(nullable: true)
        startBid(min: new Double(0.01))
        endDate(min: new Date())
        dateCreated(nullable: true)
        createdBy(nullable: false)
    }
    static hasMany = [biddings: Bidding]
    static belongsTo = [seller: Customer, winner: Customer]

}
